#define _CRT_SECURE_NO_WARNINGS
bool IsPopOrder(vector<int>& pushV, vector<int>& popV) {
    // write code here
    stack<int> v;
    int i = 0;
    for (auto& e : pushV)
    {
        v.push(e);
        while (!v.empty() && v.top() == popV[i])
        {
            v.pop();
            i++;
        }
    }
    return v.empty();
}
};